/*
 Copyright To change this template, choose Tools | Templates
 Copyright and open the template in the editor.
 */

package com.click.app.service.impl;

import com.click.app.dao.EntryProductDetailDao;
import com.click.app.model.Product;
import com.click.app.model.EntryProductDetail;
import com.click.app.service.EntryProductDetailManager;
import java.util.Date;
import java.util.List;



/**
 * @author Joel Chuca Condo
 * @date 04/05/2009
 */
public class EntryProductDetailManagerImpl extends GenericManagerImpl<EntryProductDetail, Long> implements EntryProductDetailManager {

    private EntryProductDetailDao entryProductDetailDao;

    public EntryProductDetailManagerImpl(EntryProductDetailDao entryProductDetailDao){
        super(entryProductDetailDao);
        this.entryProductDetailDao = entryProductDetailDao;
    }

    public List<EntryProductDetail> findByProduct(Product product) {
        return entryProductDetailDao.findByProduct(product);
    }

    public List<EntryProductDetail> findByProduct(Long id) {
        return entryProductDetailDao.findByProduct(id);
    }

    public List<EntryProductDetail> findByProductPeriod(Product product, Date initDate, Date endDate) {
        return entryProductDetailDao.findByProductPeriod(product, initDate, endDate);
    }

    public List<EntryProductDetail> findByProductPeriod(Long id, Date initDate, Date endDate) {
        return entryProductDetailDao.findByProductPeriod(id, initDate, endDate);
    }

    public List<Product> findAllNoPackageDetail(){
        return entryProductDetailDao.findByProductPeriod();
    }
    public List<EntryProductDetail> findByProductStockNoCero(Long id){
        return entryProductDetailDao.findByProductStockNoCero(id);
    }
}
